import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
 /*  定义路由*/
 {
	 path:"/table",
	 name:"table",
	 component:()=>import("@/views/table.vue")
 },
 {
 	 path:"/table2",
 	 name:"table2",
 	 component:()=>import("@/views/table2.vue")
 }
 	
	 
]


const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

//获取原型对象上的push函数
// const originalPush = VueRouter.prototype.push
// //修改原型对象中的push方法
// VueRouter.prototype.push = function push(location) {
//   return originalPush.call(this, location).catch(err => {
// 	  console.log(err);
// 	  console.log("信息异常")
// 	  })
// }
// const originalPush = VueRouter.prototype.push
// VueRouter.prototype.push = function push (location, onResolve, onReject) {
//   if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
//   return originalPush.call(this, location).catch(err => console.log(err))
// }
export default router
